package com.nancy.java_design.command.demo1;

public class OrderCommand implements Command {
    //具体的命令执行者
    private Chef chef;

    //订单信息
    private Order order;

    //构造方法
    public OrderCommand(Chef chef, Order order) {
        this.chef = chef;
        this.order = order;
    }

    @Override
    public void execute() {
        order.getDishes().forEach((k, v) -> {
            //调用厨师制作菜品的方法
            chef.makeFood(k, v);
        });
    }
}
